package day7;

public class Veterinary {
    private String name, phone;

    public Veterinary(String name, String phone) {
        this.name = name;
        this.phone = phone;
    }

    //给宠物看病
    //加了新宠物，这个类不动。。。
    public void cure(Pet pet) {
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        System.out.println("兽医" + name + "，号码是" + phone + "\n正在给" + pet.getName() + "看病");
        pet.introduce();
        //如果是鳄鱼，把嘴捆起来
        if (pet instanceof Crocodile) {
            ((Crocodile) pet).climb();
            System.out.println("危险，把" + pet.getName() + "嘴给捆上！");
        } else {
            ((Hamster) pet).gnawing();
            System.out.println("望闻问切");
            if (pet.getHealth() < 60) {
                System.out.println("打针，吃药，挂水");
                pet.setHealth(60);
                System.out.println("本次治疗费用1千8");
            } else {
                System.out.println(this.name + "说" + pet.getName() + "很健康，没病！");
            }
        }
    }
}